package com.woniu.userassembly.service.serviceImpl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.woniu.ly.model.model.Card;
import com.woniu.userassembly.dao.TCardMapper;
import com.woniu.userassembly.service.TCardService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author suantou
 * @since 2020-12-08
 */
@Service
public class TCardServiceImpl extends ServiceImpl<TCardMapper, Card> implements TCardService {
    @Resource
    private TCardMapper tCardMapper;

    @Override
    public int addcardtime(Timestamp ts, int cardId) {
        UpdateWrapper<Card> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("card_id",cardId);
        updateWrapper.set("card_indate",ts);
        int i = tCardMapper.update(null, updateWrapper);
        return i;
    }

    @Override
    public List<Card> selectCard() {
        return tCardMapper.selectCardTime();
    }
}
